{% extends "./base.html" %}
{% load comment_block %}

{% block title %}
{{ post.title }}
{% endblock %}

{% block extra_head %}
<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{% endblock %}

{% block main %}
{% if post %}
<h1>{{ post.title }}</h1>
<div>
    <span>作者：{{ post.owner.username }}</span>
    <span>分类：{{ post.category.name }}</span>
</div>
<hr/>
<p>
    {% autoescape off %}
    {{ post.content_html }}
    {% endautoescape %}
</p>
{% endif %}
<!--<hr>-->
<!--<div class="comment">-->
<!--    <form class="form-group" action="/comment/" method="post">-->
<!--        {% csrf_token %}-->
<!--        <input name="target" type="hidden" value="{{ request.path }}"/>-->
<!--        {{ comment_form }}-->
<!--        <input type="submit" value="写好了！"/>-->
<!--    </form>-->
<!--    &lt;!&ndash;评论列表&ndash;&gt;-->
<!--    <ul class="list-group">-->
<!--        {% for comment in comment_list %}-->
<!--        <li class="list-group-item">-->
<!--            <div class="nickname">-->
<!--                <a href="{{ comment.website }}">{{ comment.nickname }}</a>-->
<!--                <span>{{ comment.created_time }}</span>-->
<!--            </div>-->
<!--            <div class="comment-content">-->
<!--                {{ comment.content }}-->
<!--            </div>-->
<!--        </li>-->
<!--        {% endfor %}-->
<!--    </ul>-->
<!--</div>-->
{% comment_block request.path %}
{% endblock %}
